package com.spzx.user.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.api.factory.RemoteUserBrowseHistoryFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * ClassName: RemoteUserBrowseHistoryService
 * Package: com.spzx.user.api.factory
 * Description:
 *
 * @Author 梅超凡
 * @Create 2024/12/26 21:04
 * @Version 1.0
 */
@FeignClient(
        contextId = "remoteUserBrowseHistoryService" ,
        value = ServiceNameConstants.USER_SERVICE,
        fallbackFactory = RemoteUserBrowseHistoryFallbackFactory.class
)
public interface RemoteUserBrowseHistoryService {

    @GetMapping("/userBrowseHistory/saveUserBrowseHistory/{skuId}")
    public R<Boolean> saveUserBrowseHistory (
            @RequestHeader(SecurityConstants.DETAILS_USER_ID) Long userId,
            @PathVariable("skuId") Long skuId,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source
    );
}
